class CreateContacts < ActiveRecord::Migration
  def self.up
    create_table :contacts do |t|
      t.column  :role,            :string
      t.column  :first_name,      :string
      t.column  :last_name,       :string
      t.column  :phone,           :string
      t.column  :mobile,          :string
      t.column  :fax,             :string
      t.column  :email,           :string
      t.column  :created_on,      :timestamp
      t.column  :updated_on,      :timestamp
      t.column  :lock_version,    :integer, :default => 0
    end
    
    create_table :contacts_customers do |t|
      t.column  :contact_id,      :integer
      t.column  :customer_id,     :integer
    end
  end
  
  def self.down
    drop_table :contacts_customers
    drop_table :contacts
  end
end
